import React, {Component} from 'react'

class LeftCircle extends Component {
  number = 0
  state = {
    name: 'left',
    number: 0
  }
  shouldComponentUpdate(nextProps, nextState) {
    console.log(nextProps.number)
    console.log(this.props.number)
    return false
  }
  componentDidUpdate(pre, prev) {
    // console.log(prev.number)
    console.log(this.state.number)
  }
  clickTime = () => {
    this.setState(pre => ({
      name: 'aa',
      number: pre.number + 1
    }))
  }

  render() {
    console.log(111)
    return (
      <span>
        Time is {this.state.number}
        <button onClick={this.clickTime}>
          {this.number++}
        </button>  
      </span>
    )
  }
}
export default LeftCircle
